package com.video_study.controller;

import com.video_study.pojo.Comment;
import com.video_study.pojo.UserApprove;
import com.video_study.result.ResponseData;
import com.video_study.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/comments")
public class CommentController {
    @Autowired
    CommentService commentService;
    @RequestMapping(value = "/",method = RequestMethod.GET)
    public ResponseData getCommentsById(String id){
        return commentService.getCommentsById(id);
    }

    @RequestMapping(value = "/sendComment",method = RequestMethod.GET)
    public ResponseData sendComment(Comment comment){
        return commentService.sendComment(comment);
    }

    @RequestMapping(value = "/approves",method = RequestMethod.GET)
    public ResponseData getApproves(UserApprove userApprove){
        return commentService.getApproves(userApprove);
    }
}
